package com.gengdan.controller;

import com.gengdan.bean.SampleCollec;
import com.gengdan.bean.SampleCollecProcInsert;
import com.gengdan.service.SampleCollecService;
import com.gengdan.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @author ShiJiaWei
 * @version 1.0
 * @date 2020/4/20 21:44
 */
@Controller
public class SampleCollecController {
    @Autowired
    private SampleCollecService sampleCollecService;

    @Autowired
    private HashMap<String,Object> hashMap;
    /***
     * @Description 个人登记信息查询
     * @param
     * @Return java.util.HashMap
     * @Author Sun Mingshan
     * @Date 2020/4/23 18:19
     **/
    @RequestMapping("/select_personalRegister")
    @ResponseBody
    public HashMap selectAllSampleCollec(SampleCollec sampleCollec){
        hashMap =  sampleCollecService.selectPersonalRegister(sampleCollec.getUserId());
        return hashMap;
    }
    /***
    * @Description 捐献者采集信息查询
    * @param
    * @Return java.util.HashMap
    * @Author Sun Mingshan
    * @Date 2020/4/23 18:19
    **/
    @RequestMapping("/select_sampleCollec")
    @ResponseBody
    public HashMap selectSampleCollec(SampleCollec sampleCollec){
        hashMap =  sampleCollecService.selectSampleCollec(sampleCollec.getUserId());
        return hashMap;
    }
    /***
    * @Description 采集处理板块【信息显示】
    * @param
    * @Return java.util.HashMap
    * @Author Sun Mingshan
    * @Date 2020/5/9 14:54
    **/
    @RequestMapping("/select_SampleCollecProcMsg")
    @ResponseBody
    public HashMap selectSampleCollecProcMsg(Page page){
        hashMap = sampleCollecService.selectSampleCollecProcMsg(page);
        return hashMap;
    }
    /***
    * @Description 采集处理板块【高级检索】
    * @param keyWord
    * @param page
    * @Return java.util.HashMap
    * @Author Sun Mingshan
    * @Date 2020/5/9 19:42
    **/
    @RequestMapping("/select_SampleCollecMsgByKey")
    @ResponseBody
    public HashMap select_SampleCollecMsgByKey(String keyWord,Page page){
        hashMap = sampleCollecService.selectCollecMsgByKey(keyWord,page);
        return hashMap;
    }

    /***
    * @Description 获取采集模板 - 项目名称【入库员】
    * @param
    * @Return java.util.HashMap
    * @Author Sun Mingshan
    * @Date 2020/5/10 13:08
    **/
    @RequestMapping("/getCollecProcMode")
    @ResponseBody
    public HashMap getCollecProcMode(){
        hashMap = sampleCollecService.getCollecProcMode();
        return hashMap;
    }
    /***
    * @Description 采集处理插入数据【入库员】
    * @param sampleCollecProcInsert
    * @Return java.util.HashMap
    * @Author Sun Mingshan
    * @Date 2020/5/10 14:36
    **/
    @RequestMapping("/insertCollecProc")
    @ResponseBody
    public HashMap insertCollecProc(@RequestBody Map map){
        hashMap = sampleCollecService.insertSampleProc(map);
        return hashMap;
    }

}
